<!DOCTYPE html>
<html lang="en">
  <head>
    <title>MongoClient Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
  </head>
  <body>
    <a name="//apple_ref/swift/Class/MongoClient" class="dashAnchor"></a>
    <a title="MongoClient Class Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../index.html"> Docs</a> (100% documented)</p>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../index.html"> Reference</a>
        <img id="carat" src="../img/carat.png" />
        MongoClient Class Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Classes/BSON.html">BSON</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MongoClient.html">MongoClient</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MongoClientPool.html">MongoClientPool</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MongoCollection.html">MongoCollection</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MongoCursor.html">MongoCursor</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MongoDatabase.html">MongoDatabase</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MongoIndexOptions.html">MongoIndexOptions</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/MongoIndexOptionsGeo.html">MongoIndexOptionsGeo</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Enums.html">Enums</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Enums/BSONError.html">BSONError</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/MongoClientError.html">MongoClientError</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/MongoIndexStorageOptionType.html">MongoIndexStorageOptionType</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/MongoInsertFlag.html">MongoInsertFlag</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/MongoRemoveFlag.html">MongoRemoveFlag</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/MongoResult.html">MongoResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/MongoUpdateFlag.html">MongoUpdateFlag</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Functions.html">Functions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Functions.html#/s:ZF7MongoDBoi1lFTCS_4BSONS0__Sb">&lt;(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a href="../Functions.html#/s:ZF7MongoDBoi2eeFTCS_4BSONS0__Sb">==(_:_:)</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Structs.html">Structs</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Structs/MongoQueryFlag.html">MongoQueryFlag</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>MongoClient</h1>
            <p>Undocumented</p>

          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:C7MongoDB11MongoClient6Result"></a>
                    <a name="//apple_ref/swift/Alias/Result" class="dashAnchor"></a>
                    <a class="token" href="#/s:C7MongoDB11MongoClient6Result">Result</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Result Status enum for a MongoDB event</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Result</span> <span class="o">=</span> <span class="kt">MongoResult</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC7MongoDB11MongoClientcFzT3uriSS_S0_"></a>
                    <a name="//apple_ref/swift/Method/init(uri:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC7MongoDB11MongoClientcFzT3uriSS_S0_">init(uri:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create new Mongo Client connection</p>

<div class="aside aside-throws">
    <p class="aside-title">Throws</p>
    MongoClientError <q>Could not parse URI</q> if nil response

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">uri</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC7MongoDB11MongoClient5closeFT_T_"></a>
                    <a name="//apple_ref/swift/Method/close()" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC7MongoDB11MongoClient5closeFT_T_">close()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>terminate current Mongo Client connection</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">close</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC7MongoDB11MongoClient13getCollectionFTSS14collectionNameSS_CS_15MongoCollection"></a>
                    <a name="//apple_ref/swift/Method/getCollection(_:collectionName:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC7MongoDB11MongoClient13getCollectionFTSS14collectionNameSS_CS_15MongoCollection">getCollection(_:collectionName:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Return the specified MongoCollection from the specified database using current connection</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getCollection</span><span class="p">(</span><span class="nv">databaseName</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">collectionName</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">MongoCollection</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>databaseName</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>String name of database to be used</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>collectionName</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>String name of collection to be retrieved</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>MongoCollection from specified database</p>

                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC7MongoDB11MongoClient11getDatabaseFT4nameSS_CS_13MongoDatabase"></a>
                    <a name="//apple_ref/swift/Method/getDatabase(name:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC7MongoDB11MongoClient11getDatabaseFT4nameSS_CS_13MongoDatabase">getDatabase(name:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Return the named database as a MongoDatabase object</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">getDatabase</span><span class="p">(</span><span class="n">name</span> <span class="nv">databaseName</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">MongoDatabase</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>name</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>String name of database to be retrieved</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>a MongoDatabase object</p>

                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC7MongoDB11MongoClient12serverStatusFT_OS_11MongoResult"></a>
                    <a name="//apple_ref/swift/Method/serverStatus()" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC7MongoDB11MongoClient12serverStatusFT_OS_11MongoResult">serverStatus()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Get current Mongo server status</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">serverStatus</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Result</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC7MongoDB11MongoClient13databaseNamesFT_GSaSS_"></a>
                    <a name="//apple_ref/swift/Method/databaseNames()" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC7MongoDB11MongoClient13databaseNamesFT_GSaSS_">databaseNames()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Build String Array of current database names</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">databaseNames</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt">String</span><span class="p">]</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>&copy; 2016 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2016-05-25)</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.6.2</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</div>
</html>
